<?php

$mFormRollback = new FormRecovery($_POST);
$mValidation = new InputValidation();
$mFunction = new Fungsi();


$mAct = 'edt';

//SETUP USERNAME
$mValidation->SetInput($_POST['fNama']);
$mValidation->SetPattern(pUsername);
$tUsername = $mValidation->CheckValidation();

//SETUP PERSON
$mUser = new CoreUser($_SESSION['User']['Id']);
$tSalt = $mUser->GetSalt();


//$tGoto= "main.php?menu=11&submenu=111";
if ($mAct == 'edt') {
    $mFunction->SetVariableToMultiFormVariableSupport('fPersonId', $_SESSION['User']['Id'], false, false);
    $mFunction->SetVariableToMultiFormVariableSupport('fCurrentPKValue', $_SESSION['User']['Id'], false, false);

    //SETUP Nama Tabel
    $mData = new DBQueryExecute();

    $mData->SetTableName("app_user");
    $mData->SetMultiForm(false);
    $mData->SetTargerURL("main.php?menu=99&submenu=311");


    $mData->SetPrimaryKey('person_id', 'fPersonId', pUserId);
    $mData->SetField('username', 'fNama', pUsername);

    $tLevel = $_SESSION['User']['Level']; //LEVEL MEMBER

    $mData->SetValiditas($tLevel . "|" . $tUsername . "|" . $_SESSION['User']['Id'] . "|" . $tSalt);

    if (!$mData->GetError())
        $tResult = $mData->ExecuteQuery($mAct);
} else {
    if (!$mAct && $_POST['act']) {
        // ERROR: aksi tidak diketahui. kemungkinan diubah oleh user
    } else {
        // ERROR: nilai aksi tidak didefinisikan
    }
}
?>
